/**
 * A special exception type thrown when multiple plugins could not be loaded.
 */
jsx3.Class.defineClass("tibco.admin.exception.CouldNotLoadPluginsException", jsx3.lang.Exception, null, function(ex, ex_prototype) {

  ex_prototype.exceptions = null;

  /**
   * The instance initializer.
   * @param list {jsx3.util.List} a list of the <code>tibco.admin.exception.CouldNotLoadPluginException</code> exceptions
   *             thrown for each plugin that could not be loaded.
   */
  ex_prototype.init = function(list) {
      this.exceptions = list;
      var message = "One or more plugins could not be loaded.  Details follow:";
      var iter = list.iterator();
      while(iter.hasNext()) {
          var exception = iter.next();
          message += "\n" + exception.getMessage();
      }
      this.jsxsuper(message);
  };

    /**
     * Returns a string representation of the call stack for when this exception was instantiated. This stack trace
     * is delimited by new line characters (\n) but is not terminated with one.
     * @return {String}
     */
  ex_prototype.printStackTrace = function() {
      var ret = this.jsxsuper();
      var iter = this.exceptions.iterator();
      while(iter.hasNext()) {
          var ex = iter.next();
          ret += "\nRootCause:\n" + ex.printStackTrace();
      }
      return ret;
  }
});
